(function () {
    var expect = chai.expect;

    function testParseObjToOptions() {
        describe("parseObjToOptions", function () {
            it("should not transfrom", function(done) {
                var ret = aui.utils.parseObjToOptions(
                    {
                        a: 1
                    }
                );
                expect(ret[0].value).to.be.equal(1);
                done();
            })
        });
    }

    function testGetURLParameters() {
        describe("getURLParameters", function () {
            it("should parse http://url.com/page?name=Adam&surname=Smith get name Adam", function(done) {
                var ret = aui.utils.getURLParameters('http://url.com/page?name=Adam&surname=Smith');
                expect(ret.name).to.be.equal('Adam');
                done();
            })
        });
    }

    function testUtilsParam() {
        describe("param", function () {
            it("should parse {a: 1, sds: \"中文\"} to be \"a=1&sds=%E4%B8%AD%E6%96%87\" ", function(done) {
                var ret = aui.utils.param({a: 1, sds: "中文"});
                expect(ret).to.be.equal('a=1&sds=%E4%B8%AD%E6%96%87');
                done();
            })
        });
    }

    describe("aui.utils", function() {
        testParseObjToOptions();
        testGetURLParameters();
        testUtilsParam();
    });
})();